home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat3
/
Tcl
/
for.z
/
for
Wrap
Text File
|
1998-10-30
|
2KB
|
67 lines
ffffoooorrrr((((3333TTTTccccllll)))) ffffoooorrrr((((3333TTTTccccllll))))
NNNNAAAAMMMMEEEE
for - ``For'' loop
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ffffoooorrrr _s_t_a_r_t _t_e_s_t _n_e_x_t _b_o_d_y
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
FFFFoooorrrr is a looping command, similar in structure to the C ffffoooorrrr statement.
The _s_t_a_r_t, _n_e_x_t, and _b_o_d_y arguments must be Tcl command strings, and _t_e_s_t
is an expression string. The ffffoooorrrr command first invokes the Tcl
interpreter to execute _s_t_a_r_t. Then it repeatedly evaluates _t_e_s_t as an
expression; if the result is non-zero it invokes the Tcl interpreter on
_b_o_d_y, then invokes the Tcl interpreter on _n_e_x_t, then repeats the loop.
The command terminates when _t_e_s_t evaluates to 0. If a ccccoooonnnnttttiiiinnnnuuuueeee command
is invoked within _b_o_d_y then any remaining commands in the current
execution of _b_o_d_y are skipped; processing continues by invoking the Tcl
interpreter on _n_e_x_t, then evaluating _t_e_s_t, and so on. If a bbbbrrrreeeeaaaakkkk command
is invoked within _b_o_d_y or _n_e_x_t, then the ffffoooorrrr command will return
immediately. The operation of bbbbrrrreeeeaaaakkkk and ccccoooonnnnttttiiiinnnnuuuueeee are similar to the
corresponding statements in C. FFFFoooorrrr returns an empty string.
KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
for, iteration, looping
PPPPaaaaggggeeee 1111